//
//  DiscountsTableViewCell.m
//  FaceTo
//
//  Created by 程邦明 on 2017/8/8.
//  Copyright © 2017年 chengbangming. All rights reserved.
//

#import "DiscountsTableViewCell.h"

@implementation DiscountsTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initUI];
    }
    return self;
}
- (void)initUI{
    _zheLabel = [[UILabel alloc]init];
    _zheLabel.font = [UIFont systemFontOfSize:14];
    _zheLabel.textAlignment = NSTextAlignmentLeft;
    _zheLabel.textColor = Color(51, 51, 51);
    _zheLabel.text = @"9折";
    [self addSubview:_zheLabel];
    
    _reduceLabel = [[UILabel alloc]init];
    _reduceLabel.font = [UIFont systemFontOfSize:14];
    _reduceLabel.text = @"-￥2.5";
    _reduceLabel.textColor = Color(255, 210, 49);
    _reduceLabel.textAlignment = NSTextAlignmentRight;
    [self addSubview:_reduceLabel];
    
    _clickBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [_clickBtn setImage:[UIImage imageNamed:@"shopclick"] forState:UIControlStateNormal];
    [self addSubview:_clickBtn];
    
    [_zheLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.mas_centerY);
        make.left.offset(10);
        make.height.mas_equalTo(15);
    }];
    
    [_clickBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.mas_centerY);
        make.right.offset(-10);
        make.width.mas_equalTo(30);
        make.height.mas_equalTo(35);
    }];
    
    [_reduceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(_clickBtn.mas_left).with.offset(-10);
        make.centerY.equalTo(self.mas_centerY);
        make.height.mas_equalTo(15);
    }];
    
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
